package me.aip.mov.util;

import org.apache.commons.lang3.StringUtils;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class PlayerUtil {

    public static Map<String, String> playerMap = new HashMap<>();

    public static void initPlayMap() {
        playerMap.put("ukm3u8","U酷点播");
        playerMap.put("ukyun","U酷云播");
        playerMap.put("fsyun","飞速云播");
        playerMap.put("fsm3u8","飞速播放器");
        playerMap.put("sdyun","闪电云播");
        playerMap.put("miyun","大米云播");
        playerMap.put("mim3u8","大米播放器");
        playerMap.put("tsm3u8","桃色播放器");
        playerMap.put("if101","if101播放器");
        playerMap.put("sgm3u8","速更播放器");
        playerMap.put("xkyun","想看云播");
        playerMap.put("kdm3u8","酷点播放器");
        playerMap.put("xiuse","秀色播放");
        playerMap.put("wjyun","无尽②");
        playerMap.put("wjm3u8","无尽①");
        playerMap.put("hnm3u8","红牛在线");
        playerMap.put("hnyun","红牛云播");
        playerMap.put("swm3u8","丝袜播放器");
        playerMap.put("bdxyun","北斗云播");
        playerMap.put("bdxm3u8","北斗星m3u8");
        playerMap.put("tkm3u8","天空在线");
        playerMap.put("tkyun","天空云播");
        playerMap.put("hjm3u8","花椒播放器");
        playerMap.put("kbzy","快播云播");
        playerMap.put("kbm3u8","在线快播");
        playerMap.put("88zym3u8","88在线");
        playerMap.put("88zy","88云播");
        playerMap.put("smzy","色猫云播");
        playerMap.put("kkm3u8","KK在线");
        playerMap.put("dbyun","百度云播");
        playerMap.put("dbm3u8","百度在线");
        playerMap.put("bjyun","八戒云播");
        playerMap.put("bjm3u8","八戒在线");
        playerMap.put("605yun","605云播");
        playerMap.put("605m3u8","605在线");
        playerMap.put("m3u8","m3u8在线");
        playerMap.put("mgtv","芒果视频");
        playerMap.put("bilibili","bilibil");
        playerMap.put("pptv","PPTV视频");
        playerMap.put("letv","乐视视频");
        playerMap.put("sohu","搜狐视频");
        playerMap.put("qiyi","奇艺视频");
        playerMap.put("youku","优酷视频");
        playerMap.put("gsm3u8","光速m3u8");
        playerMap.put("wasu","华数TV");
        playerMap.put("m1905","1905电影网");
        playerMap.put("migu","咪咕视频");
        playerMap.put("funshion","风行");
        playerMap.put("sdm3u8","闪电m3u8");
        playerMap.put("wolong","卧龙m3u8");
        playerMap.put("xkm3u8","想看m3u8");
    }

    public static List<String> matchName(String vodPlayFrom){
        List<String> list = new ArrayList<>();
        if (StringUtils.isBlank(vodPlayFrom)){
            list.add("默认");
            return list;
        }
        String[] players = vodPlayFrom.split("\\$\\$\\$");
        for (String s : players) {
            String name = playerMap.get(s);
            list.add(name);
        }
        return list;
    }
}
